import * as fs from 'fs'
import * as path from 'path'

interface langConfigsProp {
    [propName: string]: string
}

fs.readFile(path.join(__dirname, '../config/lang.ts'), (err, data) => {
    if (err) {
        console.log(err)
    } else {
        const langConfigs: langConfigsProp = JSON.parse(data.toString())
        langConfigs.Chinese = 'cn'
        fs.writeFile(path.join(__dirname, '../config/lang.ts'),JSON.stringify(langConfigs),(err)=>{
            if (err) {
                console.log(err)
            } else {
                console.log('写入成功')
            }
        })
    }
})